<div class="div">
	<h1><?php echo $this->lang->line('institutional_title'); ?></h1>
	<fieldset>
		<form id="register_form" onsubmit="return Company.updateCompany();">
			<table class="table">
				<tbody>
					<tr>
						<td width="25%" class="right rlabel"><label for="name"><?php echo $this->lang->line('institutional_name'); ?>:</label></td>
						<td><input type="text" class="inputtext" value="<?php echo $company->name; ?>" id="name" name="name"></td>
					</tr>
					<tr>
						<td class="right rlabel"><label for="description"><?php echo $this->lang->line('institutional_description'); ?>:</label></td>
						<td>
							<textarea class="inputdiv" rows="3" value="" id="description" name="description"><?php echo $company->description; ?></textarea>
						</td>
					</tr>
					<tr>
						<td class="right rlabel"><label for="idcard"><?php echo $this->lang->line('institutional_idcard'); ?>:</label></td>
						<td><input type="text" class="inputtext maskCNPJ" value="<?php echo $company->idcard; ?>" id="idcard" name="idcard"></td>
					</tr>
					<tr>
						<td class="right rlabel"><label for="birthday"><?php echo $this->lang->line('institutional_birthday'); ?>:</label></td>
						<td>
						<select class="input" id="birthday" name="birthday">
							<option value=""></option>	
							<?php 
								for ($i = 1; $i <= 31; $i++) {
									echo '<option value="'.$i.'">'.$i.'</option>';
								}
							?>
						</select> /
						<select class="input" id="birthmonth" name="birthmonth">
							<option value=""></option>
							<option value="1"><?php echo $this->lang->line('global_january'); ?></option>
							<option value="2"><?php echo $this->lang->line('global_february'); ?></option>
							<option value="3"><?php echo $this->lang->line('global_march'); ?></option>
							<option value="4"><?php echo $this->lang->line('global_april'); ?></option>
							<option value="5"><?php echo $this->lang->line('global_may'); ?></option>
							<option value="6"><?php echo $this->lang->line('global_june'); ?></option>
							<option value="7"><?php echo $this->lang->line('global_july'); ?></option>
							<option value="8"><?php echo $this->lang->line('global_august'); ?></option>
							<option value="9"><?php echo $this->lang->line('global_september'); ?></option>
							<option value="10"><?php echo $this->lang->line('global_october'); ?></option>
							<option value="11"><?php echo $this->lang->line('global_november'); ?></option>
							<option value="12"><?php echo $this->lang->line('global_december'); ?></option>
						</select> /
						<select class="input" id="birthyear" name="birthyear">
							<option value=""></option>	
							<?php 
								for ($i = date('Y'); $i >= 1900; $i--) {
									echo '<option value="'.$i.'">'.$i.'</option>';
								}
							?>
						</select>
						</td>
					</tr>
					<tr>
						<td class="right rlabel"><label for="idcategory"><?php echo $this->lang->line('institutional_category'); ?>:</label></td>
						<td><div id="institutionalCategory"></div></td>
					</tr>
					<tr>
						<td class="right rlabel"><label for="idsize"><?php echo $this->lang->line('institutional_size'); ?>:</label></td>
						<td><div id="institutionalSize"></div></td>
					</tr>
					<tr>
						<td class="right rlabel"><label for="idcountry"><?php echo $this->lang->line('institutional_country'); ?>:</label></td>
						<td><div id="institutionalCountry"></div></td>
					</tr>
					<tr>
						<td colspan="2" class="center">
							<label for="btnEnter"><input type="submit" id="btnEnter" class="submit" value="<?php echo $this->lang->line('institutional_save'); ?>" /></label>
						</td>
					</tr>
				</tbody>
			</table>
			<div id="result"></div>
		</form>
	</fieldset>
	
	<fieldset>
	<legend><?php echo $this->lang->line('institutional_address'); ?></legend>
		<div>
			<div id="gridAddress"></div>
		</div>
		<div class="gadd">
			<a href="<?php echo base_url(); ?>company/address/add" rel="facebox"><?php echo $this->lang->line('institutional_addressadd'); ?></a>
		</div>
	</fieldset>
	
	<fieldset>
	<legend><?php echo $this->lang->line('institutional_phone'); ?></legend>
		<div>
			<div id="gridPhone"></div>
		</div>
		<div class="gadd"><a href="<?php echo base_url(); ?>company/phone/add" rel="facebox"><?php echo $this->lang->line('institutional_phoneadd'); ?></a></div>
	</fieldset>
	
	<fieldset>
	<legend><?php echo $this->lang->line('institutional_site'); ?></legend>
		<div>
			<div id="gridSite"></div>
		</div>
		<div class="gadd">
			<a href="<?php echo base_url(); ?>company/site/add" rel="facebox"><?php echo $this->lang->line('institutional_siteadd'); ?></a>
		</div>
	</fieldset>
	<br/>
	<a onclick="history.back();"><?php echo $this->lang->line('global_back'); ?></a>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>js/views/company/company.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/views/company/company_address.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/views/company/company_phone.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/views/company/company_site.js"></script>
<script type="text/javascript">
	CompanyAddress.getAddressGrid();
	CompanyPhone.getPhoneGrid();
	CompanySite.getSiteGrid();
	Company.getCategory();
	Company.getSize();
	$(".maskCNPJ").mask("99.999.999/9999-99");
	getCountry('#institutionalCountry');
	<?php 
		if (isset($extrascript)) echo $extrascript;
	?>
</script>